from sqlalchemy import Column, Integer, String, Text, DateTime, func
from ..database import Base

class Project(Base):
    __tablename__ = "projects"

    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(100), nullable=False)
    description = Column(Text)
    git_repository_url = Column(String(255), nullable=False)
    git_username = Column(String(100), nullable=False)
    git_branch = Column(String(100), default="main")
    git_access_token = Column(String(255))
    db_host = Column(String(255))
    db_port = Column(Integer)
    db_name = Column(String(100))
    db_username = Column(String(100))
    db_password = Column(String(255))
    db_schema = Column(String(100))
    db_type = Column(String(50))
    status = Column(String(20), default="active")
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), onupdate=func.now()) 